#ifndef _TAMAGAWA_H_
#define _TAMAGAWA_H_

/* Includes -------------------------------------------------------------*/
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#include "DSP28x_Project.h"
#endif


/* Defines --------------------------------------------------------------*/
#define NOERROR                        0                         /* no error*/
#define TIMEOUT                        1                         /* waiting timeout*/
#define DATAERR                        2                         /* data error (checksum error)*/
#define PRTYERR                        3                         /* parity error*/
#define FRAMERR                        4                         /* frame error*/
#define OVRNERR                        5                         /* overrun error*/
#define BRKDTERR                       6                         /* brake-detect error*/

/* Typedefs -------------------------------------------------------------*/

// extern int32_T _turns_count;
// extern int32_T _last_position;
/* Export functions -----------------------------------------------------*/
void Tamagawa_Init(void);
int32_T Tamagawa_Get_Absolute_Position(int32_T *Position);
uint16_T Tamagawa_GetSTPosition(int32_T *Position);
int32_T Tamagawa_Get_Last10_Position_and_Angle(int32_T *Position, double *angle, uint16_T status);

// uint32_T Tamagawa_GetSpeed_and_ElecAngle(uint32_T *Position, uint16_T status);

//uint16_T Tamagawa_InitPosition(uint32_T* PositionArray, uint16_T* pPositionArray);



#endif /* _TAMAGAWA_H_ */
